Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename filter param to search api "post_filter" #4119

Closed
clintongormley opened this issue Nov 7, 2013 · 3 comments
Closed

Rename filter param to search api "post_filter" #4119

clintongormley opened this issue Nov 7, 2013 · 3 comments

Comments

@clintongormley
Copy link

Users tend to use the top-level filter param for general filtering, instead of using a filtered query.

It should be renamed to post_filter to dissuade users from using it unless they understand what it is for and filter should be deprecated.

The top level filter is still valid field for backwards compatibility, but it will removed in the future.

@nik9000
Copy link
Member

nik9000 commented Nov 7, 2013

I assume I'm using it wrong then:)

@clintongormley
Copy link
Author

:) It should only be used when you want to aggregate facets on the query results, but then filter out some query results before returning the hits, eg:

  • query on brand: gucci
  • facet on: color
  • return results only for: brand:gucci, color: red

If you don't have the faceting requirement, then the color:red filter should be in a filtered query

@nik9000
Copy link
Member

nik9000 commented Nov 7, 2013

I'm not sure where I got the idea that I should just shove whatever filters I'm doing there. Maybe I just inferred it from the parameter name. Maybe some rogue documentation.

@ghost ghost assigned martijnvg Dec 16, 2013
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Dec 16, 2013
martijnvg added a commit that referenced this issue Dec 16, 2013
brusic pushed a commit to brusic/elasticsearch that referenced this issue Jan 19, 2014
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants